<extend name="admin/main"/>

<block name="title">
    <title>添加产品</title>
</block>

<block name="css">
    <link type="text/css" href="__PUBLIC__/assets/plugins/form-pagedown/css/jquery.pagedown-bootstrap.css"
          rel="stylesheet">
</block>

<block name="heading">添加产品</block>

<block name="content">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <p>Add Product</p>
        </div>
        <div class="panel-body">
            <form action="/admin/product/insert" enctype="multipart/form-data" method="post">
                <div class="form-group">
                    <label for="category">分类</label>
                    <select id="category" name="product_categories_id" class="form-control" required>
                        <foreach name="categories" item="category">
                            <option value="{$category.id}">{$category.title}</option>
                        </foreach>
                    </select>
                </div>
                <div class="form-group">
                    <label for="title">title</label>
                    <input type="text" class="form-control" name="title" id="title" required>
                </div>
                <div class="form-group">
                    <label for="icon">icon</label>
                    <input type="file" class="form-control" name="icon" id="icon" required>
                </div>
                <div class="form-group">
                    <label for="banner">banner</label>
                    <input type="file" class="form-control" name="banner" id="banner" required>
                </div>
                <div class="form-group">
                    <label for="description">description</label>
                    <input type="text" class="form-control" name="description" id="description" required>
                </div>
                <div class="form-group">
                    <label for="content">content</label>
                    <textarea id="content" name="content" required></textarea>
                </div>
                <div class="form-group">
                    <input type="submit" value="提交" class="btn btn-success">
                </div>
            </form>
        </div>
    </div>
</block>

<block name="js">
    <script type="text/javascript" src="__PUBLIC__/assets/demo/demo.js"></script>
    <script type="text/javascript" src="__PUBLIC__/assets/demo/demo-switcher.js"></script>
    <script type="text/javascript" src="__PUBLIC__/assets/plugins/bootbox/bootbox.js"></script>
    <script src="__PUBLIC__/assets/plugins/form-pagedown/js/jquery.pagedown-bootstrap.combined.js"></script>
    <script>
        $(document).ready(function () {
            $("textarea#content").pagedownBootstrap();
            $('.wmd-preview').addClass('well');
        });
    </script>
</block>
